#include <AT89X52.h>
#define RCLK P1_5
#define SDATA P1_6
#define SCLK P1_7
void Senddata(unsigned char Xdata,unsigned char Ydata)
{
unsigned char i;
RCLK=0;
for(i=0;i<8;i++)
{
SDATA=Xdata & 0x01;
SCLK=1;
SCLK=0;
Xdata=Xdata>>1;
}
for(i=0;i<8;i++)
{
SDATA=Ydata & 0x01;
SCLK=1;
SCLK=0;
Ydata=Ydata>>1;
}
RCLK=1;
}
void Delay()
{
int b;
for(b=500;b>0;b--)
{
;
}
}
void main(void)
{
int c;
unsigned char a[8]={0x18,0x18,0x18,0xff,0xff,0x18,0x18,0x18};
unsigned char d[8]={0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe};
for(c=0;c<8;c++)
{
Delay();
Senddata(d[c],a[c]);

//Senddata(0x00,0x40);
//Delay();
//Senddata(0x00,0x20);
//Delay();
//Senddata(0x00,0x10);
//Delay();
//Senddata(0x00,0x08);
//Delay();
//Senddata(0x00,0x04);
//Delay();
//Senddata(0x00,0x02);
//Delay();
//Senddata(0x00,0x01);
//Delay();
}
}

